<?php defined('SYSPATH') or die('No direct script access.');

class Model_Dao_Habits extends ORM{

	protected $_table_name  = 'habit_patients'; // default: accounts
    protected $_primary_key = 'id';      // default: id
    protected $_primary_val = 'surname';      // default: name (column used as primary value)
	    
	//'doctype_id'=> array('data_type'=>'int', 'is_nullable' => TRUE),
    
    // default for $_table_columns: use db introspection to find columns and info
    // see http://v3.kohanaphp.com/guide/api/Database_MySQL#list_columns for all possible column attributes
    protected $_table_columns = array(
        'id'   => array('data_type' => 'int',    'is_nullable' => FALSE),
       	'smoke' => array('data_type' => 'int',    'is_nullable' => TRUE), 
        'smoked'  => array('data_type' => 'int', 'is_nullable' => TRUE),
    	'years_old_at_smooke_start' => array('data_type'=>'int', 'is_nullable' => TRUE),
    	'years_old_at_smooke_finish' =>  array('data_type'=>'int', 'is_nullable' => TRUE),
    	'cigarettes_per_day' => array('data_type'=>'int', 'is_nullable' => TRUE),
    	'automedication'=> array('data_type'=>'int', 'is_nullable' => TRUE),
    	'angry_level'=> array('data_type'=>'int', 'is_nullable' => TRUE),
    	'stress_level' => array('data_type'=>'int', 'is_nullable' => TRUE),
    	'blocks_walked_per_day' => array('data_type'=>'int', 'is_nullable' => TRUE),
    	'consume_alcohol' => array('data_type'=>'int', 'is_nullable' => TRUE),
    	'sedentary'=> array('data_type'=>'int', 'is_nullable' => TRUE),
    	'work_place'=> array('data_type'=>'string', 'is_nullable' => TRUE),
    	'patient_id'=> array('data_type'=>'int', 'is_nullable' => TRUE)
    );

	//Relacion
	protected $_belongs_to = array('patient' => array('model' => 'dao_patient', 'foreign_key'=>'patient_id'));
 
}?>